import React, { Component } from 'react'
import { Table, Tag, Space } from 'antd';
import axios from 'axios'
export default class RoleList extends Component {
  state={
    columns:[
      {
        key: '1',
        name: '胡彦斌',
        age: 32,
        address: '西湖区湖底公园1号',
      },
      {
        key: '2',
        name: '胡彦祖',
        age: 42,
        address: '西湖区湖底公园1号',
      },
    ]
  }
  componentDidMount(){
    this.getRoleList()
  }
  getRoleList=()=>{
    axios.get('http://localhost:8000/posts').then(res=>{
      console.log("res",res)
    })
  }
  render() {
    const data = [
      {
    title: '姓名',
    dataIndex: 'name',
    key: 'name',
  },
  {
    title: '年龄',
    dataIndex: 'age',
    key: 'age',
  },
  {
    title: '住址',
    dataIndex: 'address',
    key: 'address',
  },
    ];
    return (
      <div>
        <Table columns={this.state.columns} dataSource={data} />
      </div>
    )
  }
}
